﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Data.Tables
{
    #region Employee
    [Table("Employee")]
    public class Employee : EmployeeFields
    { }

    public class EmployeeQuery : EmployeeFields
    {
        [Display(Name = "Name")]
        public string EmployeeName { get; set; }

        [Display(Name = "Work Location")]
        public string WorkLocationName { get; set; }

        [Display(Name = "Current Employment Type")]
        public string CurrentEmploymentType { get; set; }

        [Display(Name = "Current Rate Type")]
        public string CurrentRateType { get; set; }

        [Display(Name = "Current Rate Type")]
        public decimal CurrentRate { get; set; }

        [Display(Name = "IsActive")]
        public string IsActiveYesNo { get; set; }
    }

    public class EmployeeFields
    {
        [Key]
        [Required]
        [Display(Name = "Employee Code")]
        public string EmployeeCode { get; set; }

        [Required]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Required]
        [Display(Name = "Middle Name")]
        public string MiddleName { get; set; }

        [Required]
        [Display(Name = "Last Name")]
        public string LastName { get; set; }

        [Required]
        [Display(Name = "Address")]
        public string Address { get; set; }
        
        [Required]
        [Display(Name = "Work Location")]
        public int WorkLocationID { get; set; }

        [Display(Name = "Is Active")]
        public bool IsActive { get; set; }
    }

    #endregion

    #region Employee Contract

    [Table("EmployeeContract")]
    public class EmployeeContract : EmployeeContractFields
    { }

    public class EmployeeContractQuery : EmployeeContractFields
    {
        [Display(Name = "Rate Type")]
        public string RateTypeName { get; set; }

        [Display(Name = "Employment Type")]
        public string EmploymentTypeName { get; set; }

        [Display(Name = "Is Current")]
        public string IsCurrentYesNo { get; set; }
    }

    public class EmployeeContractFields
    {
        [Key]
        [Display(Name = "ID")]
        public int ID { get; set; }

        [Display(Name = "Employee Code")]
        public string EmployeeCode { get; set; }

        [Display(Name = "Employment Type")]
        public int EmploymentTypeID { get; set; }

        [Display(Name = "Rate Type")]
        public int RateTypeID { get; set; }

        [Display(Name = "Rate")]
        public decimal Rate { get; set; }

        [Display(Name = "Start Date")]
        public DateTime StartDate { get; set; }

        [Display(Name = "End Date")]
        public DateTime? EndDate { get; set; }

        [Display(Name = "Is Current")]
        public bool IsCurrent { get; set; }
    }

    #endregion


}